package com.partaljevic.tapestry.gambling.pages;

import com.partaljevic.gambling.Privilege;
import com.partaljevic.gambling.beans.CustomerBean;
import com.partaljevic.tapestry.gambling.service.Customers;
import org.apache.tapestry5.ioc.annotations.Inject;

public class Index {

    @Inject
    private Customers customers;

    Object onActivate() {
        CustomerBean c = new CustomerBean("danilo", "partalj");
        c.setPrivilege(Privilege.ADMINISTRATOR);
        customers.save(c);
        c = new CustomerBean("knez", "knezevic");
        c.setName("Nemanja");
        c.setEmail("knez032@yahoo.com");
        c.setSurname("Knezevic");
        customers.save(c);
        c = new CustomerBean("nesa", "nesa22");
        c.setName("Nebojsa");
        c.setEmail("micic87@hotmail.com");
        c.setSurname("Micic");
        customers.save(c);
        c = new CustomerBean("djura", "djura87");
        c.setName("Marko");
        c.setEmail("djura@hotmail.com");
        c.setSurname("Djuric");
        customers.save(c);
        return LogIn.class;
    }
}
